<?php

return array(
    // Clientscript
    'clientScript' => array(
        'class' => 'CClientScript',
        'coreScriptPosition' => CClientScript::POS_END,
        'packages' => array(
            'bootstrap-min' => array(
                'basePath' => 'root.js',
                'js' => array('bootstrap.min.js'),
                'depends' => array('jquery'),
            ),
        ),
    ),
    // Database
    'db' => require(dirname(__FILE__) . '/db.php'),
    // Cache
    'cache' => array(
        'class' => 'system.caching.CFileCache',
    ),
    // Error Handler
    'errorHandler' => array(
        // use 'app/error' action to display errors
        'errorAction' => 'error',
    ),
    // FrontlineSMS
    'sms' => array(
        'class' => 'application.components.FrontlineSmsHttpTrigger',
        'settingsID' => 'settings'
    ),
    // Logger
    'log' => array(
        'class' => 'CLogRouter',
        'routes' => array(
            array(
                'class' => 'CFileLogRoute',
                'levels' => 'error, warning',
            ),
        // uncomment the following to show log messages on web pages
        /*
          array(
          'class'=>'CWebLogRoute',
          ),
         */
        ),
    ),
    // Request
    'request' => array(
        'enableCsrfValidation' => false,
        'enableCookieValidation' => true,
    ),
    // Session
    'session' => array(
        'class' => 'CDbHttpSession',
        'connectionID' => 'db',
        'sessionTableName' => 'sessions',
        'autoCreateSessionTable' => false,
        'cookieParams' => array(
            'httponly' => true,
            'secure' => true
        )
    ),
    // Application Settings
    'settings' => array(
        'class' => 'application.components.ApplicationConfiguration',
        'cacheTime' => 0,
    ),
    // Url Manager
    'urlManager' => array(
        'urlFormat' => 'path',
        'showScriptName' => false,
        'rules' => require(dirname(__FILE__) . '/routes.php'),
    ),
    // User
    'user' => array(
        'class' => 'application.components.WebUser',
        // disable cookie-based authentication
        'allowAutoLogin' => false,
        'loginUrl' => 'login',
    ),
);
?>
